<?php
/*
 * Created on May 7, 2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
include_once 'embood.php';
include_once 'SSUtil/SSUtil.php';
ini_set("include_path", ini_get('include_path') . PATH_SEPARATOR . $CFG->dirroot.'/mod/slides/zend/library');
require_once 'Zend/Loader.php';

class emboodFetcher {
   public function fetchFromSS($ssuser) {
        $apiobj = new SSUtil();
 		$slideObj=$apiobj->get_slideUser($ssuser,0,50);
 		//if slideojb exists...TODO FIXME
  		foreach ($slideObj as $slide) {
  			$newembood = new embood;
		   	$newembood->thumbnailurl =  '<img src="'.$slide["THUMBNAIL"].'"/>';
		   	$newembood->id =$slide["ID"];
		   	$newembood->description =$slide["DESCRIPTION"];
		   	$newembood->title =$slide["TITLE"];
		   	$newembood->embedcode = $slide['EMBEDCODE'];
		   	$emboodList[]=$newembood;   
  		}
  		return $emboodList;
   }
   
   public function fetchFromYT($user){
   		Zend_Loader::loadClass('Zend_Gdata_YouTube');
   			$newembood = new embood;
		   	$newembood->thumbnailurl =  '<img src=""/>';
		   	$newembood->id ='idtest';
		   	$newembood->description ='This is a youtube video someday';
		   	$newembood->title ='kitten attacks!';
		   	$newembood->embedcode = 'not real code';
		   	$emboodList[]=$newembood; 
		   	return $emboodList;
   }
   
}
?>
